#include <bits/stdc++.h>

using namespace std;
using ll = long long;
#define endl '\n'
const int maxn = 1e6 + 500;
bool dp[maxn];  // dp[i]表示i是否是素数，也就是筛法

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n;
    cin >> n;
    fill(dp, dp + n + 1, true);
    dp[0] = dp[1] = false;
    for (int i = 2; i <= n / i; i++) {
        if (dp[i])
            for (int j = i * i; j <= n; j += i) {
                dp[j] = false;
            }
    }

    int tot = 0;
    if (n >= 3) ++tot;
    for (int p = 3; p + 2 <= n; p += 2) {
        if (dp[p] && dp[p + 2]) {
            ++tot;
        }
    }
    cout << tot;

    return 0;
}